<div id="content">       

    <? if($this->input->post("submit_action") !== FALSE){ ?>
        <div class="response"><?=validation_errors()?></div>                
    <? } ?>

    <div class="content_block">
        <? if($action == "create"){?>
        <h1>Create a new Administration Portal User</h1>
        <? }else{ ?>
        <h1>Edit User <i><?=$item['Username']?></i></h1>
        <? } ?>
    </div>

    <form action="" method="post">

    <div class="content_block" style="margin-bottom:10px">
        <h4 style="width:100px; float:left">Username</h4>
        <input style="width:200px" name="username" type="text" class="text_input" maxlength="36" value="<?=set_value('username', $item['Username'])?>" />
    </div>

    <div class="content_block" style="margin-bottom:10px">
        <h4 style="width:100px; float:left"><?if($action=='update') print 'New '?>Password</h4>
        <input style="width:200px" name="password" type="text" class="text_input" maxlength="36" value="<?=set_value('password')?>" />
    </div>

    <div class="content_block">
        <h4 style="width:100px; float:left">Type</h4>
        <? if ($item['id'] != ADMIN_MASTER_ID) { ?>
            <select name="role" style="width:200px">
                <option value=""></option>
            <? foreach($roles as $role){ ?>
                <option value="<?=$role["id_Roles"]?>" <?=set_select('role',$role["id_Roles"],($item['Role']==$role["id_Roles"]));?>><?=$role["Name_Roles"]?></option>
            <? } ?>
        </select>
        <? } else { ?>
            <?=$item['Name_Roles']?>
            <input type="hidden" name="role" value="<?=$item['Role']?>"
        <? } ?>
    </div>
         
    <div class="content_block">
        <a href="<?=site_url('admin/users')?>" class="button">CANCEL</a>
        <input type="hidden" name="token" value="<?=$token?>" />

        <? if ($action=="update") { ?>
        <input type="hidden" name="id" value="<?=$item['id']?>" />
        <? } ?>
        <input type="hidden" name="submit_action" value="<?=$action?>" />
        <input type="submit" class="button" value="SAVE" />
    </div>

    </form>

</div>